<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>
    资源下载-添加
  </title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/x-admin.css" media="all">
</head>
<script src="${pageContext.request.contextPath}/static/js/jquery.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/static/lib/layui/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/static/js/x-layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/static/js/js.js" charset="utf-8"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/lib/layui/css/layui.css" media="all">
<body>
<div class="x-body">
  <form class="layui-form" action="${pageContext.request.contextPath}/editDrug"  method="post" >
    <input type="hidden" name="drugid" />
    <input type="hidden" name="dstatus" />
    <div class="layui-form-item">
      <label class="layui-form-label">药品名称</label>
      <div class="layui-input-block">
        <input type="text" value="${d.drugname}" name="drugname" required  lay-verify="required" placeholder="请输入药品名称" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">药品价格</label>
      <div class="layui-input-block">
        <input type="text" value="${d.drugprice}" name="drugprice" required  lay-verify="required" placeholder="请输入药品价格" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">生产日期</label>
      <div class="layui-input-inline">
        <input type="text" id="etime" value="${d.productiondate}" name="productiondate" required="" lay-verify="required" autocomplete="off"
               class="layui-input">
      </div>
    </div>
    <script>
      layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
          elem: '#etime' //指定元素
        });
      });
    </script>
    <div class="layui-form-item">
      <label class="layui-form-label">保质期</label>
      <div class="layui-input-block">
        <input type="text" value="${d.shelflife}" name="shelflife" required  lay-verify="required" placeholder="请输入保质期" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">药品分类</label>
      <div class="layui-input-block">
        <select name="cid" lay-verify="required">
          <c:forEach items="${dc}" var="c">
            <option value="${c.cid}">${c.cname}</option>
          </c:forEach>
        </select>
      </div>
    </div>
    <div class="layui-form-item layui-form-text">
      <label class="layui-form-label">备注</label>
      <div class="layui-input-block">
        <textarea name="note" placeholder="请输入备注" class="layui-textarea">${d.note}</textarea>
      </div>
    </div>

    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" onclick="fn()" lay-submit lay-filter="formDemo">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
      </div>
    </div>
  </form>
  <script>
    //Demo
    layui.use('form','laydate', function(){
      var form = layui.form;
      //监听提交
      form.on('submit(formDemo)', function(data){
        layer.msg(JSON.stringify(data.field));
        return false;
      });

    });
  </script>
  <script>
    function fn(){
      x_admin_close();
      window.parent.location.reload();
    }
  </script>
</div>
</body>

</html>
